//
// Created by jiangpenghui on 2023/4/18.
//

#ifndef CMAKECXX_POINT_H
#define CMAKECXX_POINT_H

#include <iostream>
#include <string>

using namespace std;

class Point {
public:
    int x, y, z;

    Point(int x, int y, int z) : x(x), y(y), z(z) {};

    Point(const Point &point) : x(point.x), y(point.y), z(point.z) {}

    // 定义 = 操作符，将 rhs 成员对象赋值到当前对象
    Point &operator=(const Point &rhs) {
        x = rhs.x;
        y = rhs.y;
        z = rhs.z;
        return *this;
    }

    friend ostream &operator<<(ostream &os, const Point &p) {
        return os << "X=" << p.x << "Y= " << p.y << "Z=" << p.z;
    }
};

class Vector {
public:
    int magnitude, direction;

    Vector(int m, int d) : magnitude(m), direction(d) {
        cout << "structure Vector " << endl;
    }

};

class Space {
public:
    static Point translate(Point p, Vector v) {
        p.x += v.magnitude + v.direction;
        p.y += v.magnitude + v.direction;
        p.z += v.magnitude + v.direction;
        return p;
    }
};

#endif //CMAKECXX_POINT_H
